package ${basePackage};

import com.orientsec.dts.option.NotNull;
import com.orientsec.dts.option.enums.BusinessType;
import com.orientsec.dts.option.enums.Market;
import com.orientsec.dts.option.enums.ReturnOrder;
import com.orientsec.dts.option.messages.query.base.QueryBase;

/**
 * @description: ${msgDesc}
 * @author: ${author}
 */
public class ${msgName} extends AuctionOrder {

<#if param_combine_list?exists>
    <#list param_combine_list as param>
        <#if (param.msgParamType?lower_case = 'innerclass')>
    /**
     * ${param.paramDesc}
     */
    private List<${param.paramType}> ${param.paramName} = new ArrayList<>();
        <#else>
    /**
     * ${param.paramDesc}
     */
            <#if (param.defaultValue?exists)>
    private ${param.paramType} ${param.paramName} = ${param.defaultValue};
            <#else>
    @NotNull
    private ${param.paramType} ${param.paramName};
            </#if>
        </#if>
    </#list>
</#if>


    <#if inner_class?exists>
    /**
     * @description: ${inner_class['msgDesc']}
     */
    public static class ${inner_class['msgName']?cap_first} {
            <#if inner_class['param_combine_list']?exists>
                <#list inner_class['param_combine_list'] as param>
        /**
         * ${param.paramDesc}
         * 数据类型 ${param.charDesc}
         */
        private ${param.msgParamType} ${param.paramName};
                </#list>
            </#if>

        @Override
        public String toString() {
            StringBuffer sb = new StringBuffer();
            sb.append("${inner_class['msgName']} [");
            <#if inner_class['param_combine_list']?exists>
                <#list inner_class['param_combine_list'] as param>
            sb.append("${param.paramName} =").append(${param.paramName});
                </#list>
            </#if>
            sb.append("]");
            return sb.toString();
        }

        <#if inner_class['param_combine_list']?exists>
            <#list inner_class['param_combine_list'] as param>
        public void set${param.paramName?cap_first}(${param.msgParamType} ${param.paramName}) {
            this.${param.paramName} = ${param.paramName};
        }

        public ${param.msgParamType} get${param.paramName?cap_first}() {
            return ${param.paramName};
        }

            </#list>
        </#if>
    }
    </#if>


    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("${msgName} [");
        <#if combine_list?exists>
            <#list combine_list as param>
        sb.append("${param.paramName} =").append(${param.paramName});
            </#list>
        </#if>
        sb.append("MsgType=").append(getMsgType())
        .append("]");
        return sb.toString();
    }

    <#if param_combine_list?exists>
        <#list param_combine_list as param>
            <#if (param.baseType?lower_case = 'innerclass')>
    public void set${param.paramName?cap_first}(List<${param.paramType}> ${param.paramName}) {
        this.${param.paramName} = ${param.paramName};
    }

    public List<${param.paramType}> get${param.paramName?cap_first}() {
        return ${param.paramName};
    }
            <#elseif (param.baseType?lower_case = 'enum') >
    public void set${param.paramName?cap_first}(${param.paramType} ${param.paramName}) {
        this.${param.paramName} = ${param.paramName};
    }

    public ${param.paramType} get${param.paramName?cap_first}() {
        return ${param.paramName};
    }

            <#else >
                <#if (param.paramCharType?lower_case = 'amt')>
    public void set${param.paramName?cap_first}(BigDecimal ${param.paramName}) {
        this.${param.paramName} = BigDecimal.valueOf(10000).multiply(${param.paramName}).longValue();
    }

    public BigDecimal get${param.paramName?cap_first}() {
        return new BigDecimal(${param.paramName}).divide(new BigDecimal(10000), 4, RoundingMode.HALF_UP);
    }

                <#elseif (param.paramCharType?lower_case = 'qty') >
    public void set${param.paramName?cap_first}(BigDecimal ${param.paramName}) {
        this.${param.paramName} = BigDecimal.valueOf(100).multiply(${param.paramName}).longValue();
    }

    public BigDecimal get${param.paramName?cap_first}() {
        return new BigDecimal(${param.paramName}).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
    }
                <#else >
    public void set${param.paramName?cap_first}(${param.msgParamType} ${param.paramName}) {
        this.${param.paramName} = ${param.paramName};
    }

    public ${param.msgParamType} get${param.paramName?cap_first}() {
        return ${param.paramName};
    }

                </#if>
            </#if>
        </#list>
    </#if>
}
